package top.appx.easysql.data;

import java.util.List;

/**
 * Created by john on 2015/12/10.
 */
public class PageInfo<T> {
    private int page;
    private int pageSize;
    private int total;
    private List<T> data;


    public PageInfo(){

    }
    public PageInfo(int page,int pageSize){
        this.page = page;
        this.pageSize = pageSize;
    }


    public int getPage() {
        if(this.page == 0){
            return 1;
        }
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getPageSize() {
        if(this.pageSize==0){
            return 20;
        }
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
